package cn.etynit.web.controller;

import cn.etynit.service.IAnnunciateService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

/**
 * 缴费通知类
 */
//@Component
@RestController
@Api(value = "通知接口",description = "此接口是小区缴费以及公共通知相关的类")
public class AnnunciateController {

    @Autowired
    private IAnnunciateService annunciateService;

    /**
     * 缴费通知
     */
    @Scheduled(cron = "*/10 * * * * ?")   //定时器定义，设置执行时间
    private void adviceCharge() {
        annunciateService.adviceCharge();
    }



//    private Integer time = 0;

//    @Scheduled(cron = "*/10 * * * * ?")   //定时器定义，设置执行时间
//    private void process1() {
//        System.out.println("定时器1执行"+time++);
//    }
//    @Scheduled(fixedDelay = 1*1000)   //定时器定义，设置执行时间 1s
//    private void process2() {
//        System.out.println("定时器2执行"+time++);
//    }
}
